feat(core): configure model reasoning capabilities - #10999
Conversation
|
Thanks for the PR — the write-up and the design doc are unusually clear about intent, which made this easy to follow. Template looks good ✓ (all required headings present, Tested-on filled in, Chinese section included). Problem: this is a
So the question this PR raises is not "should models declare their reasoning capability" (they should) but where that declaration lives: in the provider preset / model registry (this PR), or in the provider adapter (today). After this PR both mechanisms are live at once, and they disagree. Direction: escalating to a maintainer. This touches model selection, adds a new user-editable settings contract ( Size: 534 changed lines total → 368 production (core 105, cli 263), 126 test, 40 docs (the design doc). Approach — what I'd want answered before this goes further. I skimmed the code closely enough to have opinions, so here they are as questions rather than as a block:
Risk: the revert-history screen matched four high-risk paths — Testing: CI on the reviewed commit was still in flight when this ran — Not moving on to code review as a separate stage: the direction question above is the thing to settle first, and I would rather hand it over with the concerns named than approve or reject around it. No approval and no request-changes from me — this needs a human call. I could not resolve an accountable owner deterministically (the PR carries no area label, there is no prior human reviewer, and no maintainer handle is configured), so no @mention: whoever owns model/provider config, this one is for you. 中文说明感谢贡献 —— PR 描述和设计文档把意图讲得很清楚,读起来很顺。 模板完整 ✓(必需标题齐全,Tested-on 已填写,含中文说明)。 **问题:**这是
所以真正要回答的不是"模型该不该声明 reasoning 能力"(该),而是这份声明放在哪里:provider preset / 模型注册表(本 PR),还是 provider 适配器(现状)。本 PR 之后两套机制同时存在,而且结论互相冲突。 **方向:转交 maintainer。**这触及模型选择、新增了用户可编辑的 settings 契约( **规模:**共 534 行改动 → 生产 368 行(core 105、cli 263)、测试 126 行、文档 40 行(设计文档)。 **方案 —— 继续推进前希望先有答案的点。**我把代码看得足够细,所以直接以问题形式提出,而不是当作拦截:
**风险:**回滚历史筛查命中四个高风险路径 —— **测试:**本次运行时该 commit 的 CI 仍在进行 —— 不再单独进入代码审查阶段:上面这个方向问题应当先定,与其绕过它去批准或拒绝,不如把顾虑讲清楚交出去。我没有批准,也没有 request changes —— 这一条需要人来定。我无法确定地解析出责任人(PR 没有 area 标签、没有既有的人类 reviewer、也没有配置 maintainer handle),所以没有 @:负责 model/provider 配置的维护者,这一条交给你。 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
🩺 serve daemon A/BBuilt the PR base vs this PR head ✅ No response changes against the PR base across 12 scenario(s). — Qwen Code · serve A/B |
What this PR does
Adds a declarative reasoning capability to existing provider model definitions and carries it through the current model registry into ACP, session restoration, workspace previews, TUI effort controls, and the final OpenAI-compatible request. The native
deepseek-v4-proentry is the only newly configured model: it exposeshighandmax, defaults tohigh, and disables reasoning withthinking.type = disabled.Why it's needed
Adding reasoning support for a model should be a provider-configuration change, not another model-name or hostname branch spread across clients and request adapters. This establishes that contract once and uses one DeepSeek model to prove that future model additions can remain configuration-only.
Reviewer Test Plan
How to verify
Configure the native DeepSeek provider and select
deepseek-v4-pro. Confirm that ACP/WebShell and both TUI effort pickers expose onlyhighandmax, withhighselected by default. Selectmaxand confirm the final request contains top-levelreasoning_effort: "max"without a nested effort. Disable reasoning and confirm the request containsthinking: { "type": "disabled" }. Switch to a model without an explicit reasoning capability and confirm no new provider-specific behavior is inferred.Evidence (Before & After)
Before: the generic effort control could offer tiers not native to the selected model, and model support required code-side provider knowledge. After:
deepseek-v4-prooffers only its configured tiers and the same configuration determines the final wire fields. Automated coverage verifies capability propagation, invalid-tier fallback, disable payloads, session reconciliation, and TUI filtering.Tested on
Environment (optional)
Node.js 22; focused Vitest suites plus full build, typecheck, and lint.
Risk & Scope
Linked Issues
Narrow successor to #10913 and #9590.
中文说明
本 PR 做了什么
在现有 provider 模型定义中加入声明式 reasoning capability,并通过既有模型注册表传递给 ACP、会话恢复、workspace preview、TUI effort 控件和最终 OpenAI-compatible 请求。本 PR 只为原生
deepseek-v4-pro增加配置:仅展示high和max,默认high,关闭推理时发送thinking.type = disabled。为什么需要
新增模型的 reasoning 支持应该只修改 provider 配置,而不应继续在客户端和请求适配器中散布模型名或 hostname 分支。本 PR 一次性建立该契约,并用一个 DeepSeek 模型证明后续模型可以仅通过配置接入。
Reviewer 测试计划
如何验证
配置原生 DeepSeek provider 并选择
deepseek-v4-pro。确认 ACP/WebShell 和两套 TUI effort picker 只展示high、max,默认选择high。选择max后确认最终请求包含顶层reasoning_effort: "max"且没有嵌套 effort。关闭 reasoning 后确认请求包含thinking: { "type": "disabled" }。切换到没有显式 reasoning capability 的模型,确认不会推断新的 provider 专有行为。Before / After 证据
Before:通用 effort 控件可能展示模型不原生支持的档位,新增模型还需要在代码中加入 provider 知识。After:
deepseek-v4-pro只展示配置声明的档位,同一配置决定最终 wire 字段。自动化测试覆盖 capability 透传、非法档位回落、关闭 payload、会话重校验和 TUI 过滤。测试环境
macOS + Node.js 22;聚焦 Vitest、完整 build、typecheck 和 lint 均通过。Windows 和 Linux 未本地验证。
风险与范围
关联
#10913 和 #9590 的精简继任实现。